package com.iwhalecloud.citybrain.flow.platform.manager.common.client;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * Dto - 通知设置
 *
 * @author lilh
 * @date 2019-07-11 10:22
 */
public class HttpTaskNoticeSettingDto extends HttpCommandDto {
    private static final long serialVersionUID = 1007600295266474194L;

    /**
     * 操作人信息
     */
    private String participantId;

    /** 操作人名称 */
    private String participantName;

    /** 类型，仅支持STA/USR,表示操作人 */
    private String participantType;


    /** 节点通知配置 */
    private List<NodeItem> nodeItems = new ArrayList<>();

    public HttpTaskNoticeSettingDto() {
        this.setCommandCode("taskNoticeSetting");
    }

    public String getParticipantId() {
        return participantId;
    }

    public void setParticipantId(String participantId) {
        this.participantId = participantId;
    }

    public String getParticipantName() {
        return participantName;
    }

    public void setParticipantName(String participantName) {
        this.participantName = participantName;
    }

    public String getParticipantType() {
        return participantType;
    }

    public void setParticipantType(String participantType) {
        this.participantType = participantType;
    }

    public List<NodeItem> getNodeItems() {
        return nodeItems;
    }

    public void setNodeItems(List<NodeItem> nodeItems) {
        this.nodeItems = nodeItems;
    }

    public static class NodeItem implements Serializable {
        private static final long serialVersionUID = -2844878883265176780L;

        /** 节点编码 */
        private String nodeCode;

        /** 通知项 */
        List<NoticeItem> noticeItems;

        public String getNodeCode() {
            return nodeCode;
        }

        public void setNodeCode(String nodeCode) {
            this.nodeCode = nodeCode;
        }

        public List<NoticeItem> getNoticeItems() {
            return noticeItems;
        }

        public void setNoticeItems(List<NoticeItem> noticeItems) {
            this.noticeItems = noticeItems;
        }
    }


    public static class NoticeItem implements Serializable {
        private static final long serialVersionUID = 8311029663228133526L;

        /** 是否通知，Y/N */
        private String notice;

        /** 通知类型，办理，超时，预警 */
        private String noticeType;

        /** 日历类型，日历日和工作日 */
        private String calendarType;

        /** 天 */
        private Integer day;

        /** 小时 */
        private Integer hour;

        /** 分 */
        private Integer minutes;

        /** 通知标题 */
        private String noticeTitle;

        /** 通知内容 */
        private String noticeContent;

        /** 通知渠道 */
        private Set<String> noticeChannels;

        /** 通知人 */
        private Set<String> notifiers;

        /** 预警规则，当noticeType为预警时，该字段有效 */
        List<WarningItem> warningItems;

        public String getNotice() {
            return notice;
        }

        public void setNotice(String notice) {
            this.notice = notice;
        }

        public String getNoticeType() {
            return noticeType;
        }

        public void setNoticeType(String noticeType) {
            this.noticeType = noticeType;
        }

        public String getCalendarType() {
            return calendarType;
        }

        public void setCalendarType(String calendarType) {
            this.calendarType = calendarType;
        }

        public Integer getDay() {
            return day;
        }

        public void setDay(Integer day) {
            this.day = day;
        }

        public Integer getHour() {
            return hour;
        }

        public void setHour(Integer hour) {
            this.hour = hour;
        }

        public Integer getMinutes() {
            return minutes;
        }

        public void setMinutes(Integer minutes) {
            this.minutes = minutes;
        }

        public String getNoticeTitle() {
            return noticeTitle;
        }

        public void setNoticeTitle(String noticeTitle) {
            this.noticeTitle = noticeTitle;
        }

        public String getNoticeContent() {
            return noticeContent;
        }

        public void setNoticeContent(String noticeContent) {
            this.noticeContent = noticeContent;
        }

        public Set<String> getNoticeChannels() {
            return noticeChannels;
        }

        public void setNoticeChannels(Set<String> noticeChannels) {
            this.noticeChannels = noticeChannels;
        }

        public Set<String> getNotifiers() {
            return notifiers;
        }

        public void setNotifiers(Set<String> notifiers) {
            this.notifiers = notifiers;
        }

        public List<WarningItem> getWarningItems() {
            return warningItems;
        }

        public void setWarningItems(List<WarningItem> warningItems) {
            this.warningItems = warningItems;
        }
    }


    /**
     * 预警
     */
    public static class WarningItem implements Serializable {

        private static final long serialVersionUID = -8110032354840245435L;

        /** 预警编码 */
        private String warningCode;

        /** 天 */
        private Integer day;

        /** 小时 */
        private Integer hour;

        /** 分 */
        private Integer minutes;

        /** 通知渠道 */
        private Set<String> noticeChannels;

        /** 通知人 */
        private Set<String> notifiers;

        public String getWarningCode() {
            return warningCode;
        }

        public void setWarningCode(String warningCode) {
            this.warningCode = warningCode;
        }

        public Integer getDay() {
            return day;
        }

        public void setDay(Integer day) {
            this.day = day;
        }

        public Integer getHour() {
            return hour;
        }

        public void setHour(Integer hour) {
            this.hour = hour;
        }

        public Integer getMinutes() {
            return minutes;
        }

        public void setMinutes(Integer minutes) {
            this.minutes = minutes;
        }

        public Set<String> getNoticeChannels() {
            return noticeChannels;
        }

        public void setNoticeChannels(Set<String> noticeChannels) {
            this.noticeChannels = noticeChannels;
        }

        public Set<String> getNotifiers() {
            return notifiers;
        }

        public void setNotifiers(Set<String> notifiers) {
            this.notifiers = notifiers;
        }
    }
}
